<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="xml" omit-xml-declaration="yes"/>


<xsl:template name="tv-index-1-style-and-script">


 
<!--*************************************************Start of redefined TV scripts*******************************************-->


<style>
#navtable {visibility:hidden;}
#navimage {visibility:hidden; position:absolute; top:1; left:57;}
#navlinks {visibility:hidden;position:absolute; top:175; left:525;}
#Titles {font-size:18pt;color:#AAAAAA;}
#imagebkgd {visibility:hidden;position:absolute; top:0; left:50;}
#imagecopy {visibility:hidden;position:absolute; top:345; left:75;}
#imageright {visibility:hidden;position:absolute; top:25; left:75;}
#imageleft {visibility:hidden;position:absolute; top:490; left:75;}
#frames {visibility:hidden;position:absolute; top:0; left:50;}
#coverframe {visibility:hidden;position:absolute; top:309; left:3;}
#coverbkgnd {visibility:hidden;position:absolute; top:325; left:3;}
#coverbkgnd2 {visibility:hidden;position:absolute; top:362; left:480;}
#tvfanartoverlay {visibility:visible;position:absolute; top:36; left:600;}

<xsl:choose>
<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 6">
#image1 {visibility:visible}
</xsl:when>
<xsl:otherwise>
#image1 {visibility:hidden}
</xsl:otherwise>
</xsl:choose>

<xsl:choose>
<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 5">
#image2 {visibility:visible}
</xsl:when>
<xsl:otherwise>
#image2 {visibility:hidden}
</xsl:otherwise>
</xsl:choose>

<xsl:choose>
<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 4">
#image3 {visibility:visible}
</xsl:when>
<xsl:otherwise>
#image3 {visibility:hidden}
</xsl:otherwise>
</xsl:choose>

#changeimage {visibility:visible}

<xsl:choose>
<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 1">
#image5 {visibility:visible}
</xsl:when>
<xsl:otherwise>
#image5 {visibility:hidden}
</xsl:otherwise>
</xsl:choose>

<xsl:choose>
<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 2">
#image6 {visibility:visible}
</xsl:when>
<xsl:otherwise>
#image6 {visibility:hidden}
</xsl:otherwise>
</xsl:choose>


<xsl:choose>
<xsl:when test="count(library/movies/movie[@isExtra!='true']) > 3">
#image7 {visibility:visible}
</xsl:when>
<xsl:otherwise>
#image7 {visibility:hidden}
</xsl:otherwise>
</xsl:choose>

</style>
<title>MovieJukebox</title>
<script type="text/javascript" src="pictures/passit.js">&#160;</script>

<script>

var xon= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:choose><xsl:when test="@isSet='true'"><xsl:value-of select="substring-before(details,'.html')" disable-output-escaping="yes"/></xsl:when><xsl:otherwise><xsl:value-of select="baseFilename" disable-output-escaping="yes"/></xsl:otherwise></xsl:choose>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];

var switchTime=0;
var testmove=0;
var yonsa=0;
</script>

<script>
var titles= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:choose><xsl:when test="//index[@current='true']/@name ='TV Shows'"><xsl:value-of disable-output-escaping="yes" select="translate(title,'&#58;', &quot;-&quot;)"/></xsl:when><xsl:otherwise><xsl:value-of select="translate(title,'&#58;', &quot;-&quot;)"/>#<xsl:value-of select='season'/></xsl:otherwise></xsl:choose>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];
</script>

<script>
var plots=[
<xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:value-of select="concat(substring(translate(plot,'&quot;', &quot;'&quot;), 1, 500), '.')" />"
<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];
</script>


<script>
var banners= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:value-of select='bannerFile'/>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];
</script>

<script>
var fanart= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:value-of select='fanartFile'/>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];
</script>

<script>
var rating= [
   <xsl:for-each select="library/movies/movie[@isExtra!='true']">"<xsl:value-of select='certification'/>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];


var ratingsys= new Array();

ratingsys['G']=1;
ratingsys['PG']=10;
ratingsys['PG-13']=13;
ratingsys['R']=18;
ratingsys['NC-17']=17;
ratingsys['Not Rated']=18;

ratingsys['TV-Y']=1;
ratingsys['TV-Y7']=7;
ratingsys['TV-G']=10;
ratingsys['TV-PG']=13;
ratingsys['TV-14']=14;
ratingsys['TV-MA']=16;

ratingsys['U']=1;
ratingsys['PG']=10;
ratingsys['12']=12;
ratingsys['12A']=13;
ratingsys['15']=15;
ratingsys['18']=18;
ratingsys['R18']=99;

ratingsys['X']=99;
ratingsys['XX']=99;
ratingsys['XXX']=99;

var ratingnow=0;
</script>

<script>
var yon=0;
var searching=1;
var searchlist=0;
var input=0;
var titlelow=0;
var inputlow=0;
var yonda=0;
var searchbanner=0;

<!--######old code, just for reference    if( titlelow.substring(0,lengthtest)==input.substring(0,lengthtest) )#########-->



function searchthis()
{
yon=yon;

if (searching==1)
  {
	var I=0;
	input= prompt("Enter Search Word","")
	searchlist= new Array();
	searchbanner=new Array();

	var lengthtest=input.length;
	
	if (lengthtest==1)
		{
			for(I=0;I <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> titles.length; I++)
				{
		 			titlelow= titles[I].toLowerCase();
		  			inputlow= input.toLowerCase();
			
					if (titlelow.substring(0,3)=="the")
				 		{
					  		if( titlelow.substring(4,5)==input.substring(0,1))
								{
							  		searchlist[searchlist.length] = xon[I]
									searchbanner[searchbanner.length] =banners[I]
			 					}
				 		}
					else
						{
							if( titlelow.substring(0,1)==input.substring(0,1) )
			 					{
			 			  			searchlist[searchlist.length] = xon[I]
									searchbanner[searchbanner.length] =banners[I]
			 					}
						}
				}
		}

	else
		{
    
			for(I=0;I <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> titles.length; I++)
				{
		  			titlelow= titles[I].toLowerCase();
		  			inputlow= input.toLowerCase();

		  			if( titlelow.match(inputlow) )
			 			{
			  	  			searchlist[searchlist.length] = xon[I]
							searchbanner[searchbanner.length] =banners[I]
			 			}
		 		}

		}
		 yon=0;
		searching=0;

		moviechange(yon)
  
	}
else
	{
		searching=1;
		yonda = findItem( xon, searchlist[(yon + searchlist.length) % searchlist.length])

		moviechange(yonda)

	}

}

</script>

<script>

function moviechange(y)
{
var glen = xon.length
var ending = glen - 1
var last = ending - 1

if (yon+y<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>0)
{
yon=ending
}
else if (yon+y<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>ending)
{
yon=0
}
else
{
yon=yon+y
}


if (searching==0)
{

  if (searchlist.length == 1)
  {
	document.styleSheets[1].cssRules[13].style.visibility='hidden'
	document.styleSheets[1].cssRules[14].style.visibility='hidden'
	document.styleSheets[1].cssRules[15].style.visibility='hidden'
	document.styleSheets[1].cssRules[17].style.visibility='hidden'
	document.styleSheets[1].cssRules[18].style.visibility='hidden'
	document.styleSheets[1].cssRules[19].style.visibility='hidden'
	
  }
  else if (searchlist.length==2)
  {
	document.styleSheets[1].cssRules[13].style.visibility='hidden'
	document.styleSheets[1].cssRules[14].style.visibility='hidden'
	document.styleSheets[1].cssRules[15].style.visibility='hidden'
	
	document.styleSheets[1].cssRules[18].style.visibility='hidden'
	document.styleSheets[1].cssRules[19].style.visibility='hidden'
  }

  else if (searchlist.length==3)
  {
	document.styleSheets[1].cssRules[13].style.visibility='hidden'
	document.styleSheets[1].cssRules[14].style.visibility='hidden'
	document.styleSheets[1].cssRules[15].style.visibility='hidden'
	
	document.styleSheets[1].cssRules[19].style.visibility='hidden'
  }
  else if (searchlist.length==4)
  {
 document.styleSheets[1].cssRules[13].style.visibility='hidden'
	document.styleSheets[1].cssRules[14].style.visibility='hidden'
	document.styleSheets[1].cssRules[15].style.visibility='hidden'
	
  }
  else if (searchlist.length==5)
  {
  document.styleSheets[1].cssRules[13].style.visibility='hidden'
	document.styleSheets[1].cssRules[14].style.visibility='hidden'
	
  }
  else if (searchlist.length==6)
  {
  document.styleSheets[1].cssRules[13].style.visibility='hidden'
	
  }

var m1= searchlist[(yon-3+ searchlist.length) % searchlist.length]
var m2 =searchlist[(yon-2+ searchlist.length) % searchlist.length]
var m3 =searchlist[(yon-1+ searchlist.length) % searchlist.length]
var m4= searchlist[(yon+ searchlist.length) % searchlist.length]
var m5 =searchlist[(yon +1+ searchlist.length) % searchlist.length]
var m6 =searchlist[(yon+2+ searchlist.length) % searchlist.length]
var m7= searchlist[(yon+3+ searchlist.length) % searchlist.length]

var b1= searchbanner[(yon-3+ searchbanner.length) % searchbanner.length]
var b2 =searchbanner[(yon-2+ searchbanner.length) % searchbanner.length]
var b3 =searchbanner[(yon-1+ searchbanner.length) % searchbanner.length]
var b4= searchbanner[(yon+ searchbanner.length) % searchbanner.length]
var b5 =searchbanner[(yon +1+ searchbanner.length) % searchbanner.length]
var b6 =searchbanner[(yon+2+ searchbanner.length) % searchbanner.length]
var b7= searchbanner[(yon+3+ searchbanner.length) % searchbanner.length]
}
else
{


	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 6">
	document.styleSheets[1].cssRules[13].style.visibility='visible'
	</xsl:if>
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 5">
	document.styleSheets[1].cssRules[14].style.visibility='visible'
	</xsl:if>
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 4">
	document.styleSheets[1].cssRules[15].style.visibility='visible'
	</xsl:if>
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 3">
	document.styleSheets[1].cssRules[17].style.visibility='visible'
	</xsl:if>
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 2">
	document.styleSheets[1].cssRules[18].style.visibility='visible'
	</xsl:if>
	<xsl:if test="count(library/movies/movie[@isExtra!='true']) > 1">
	document.styleSheets[1].cssRules[19].style.visibility='visible'
	</xsl:if>
	

var m1= xon[(yon-3+ xon.length) % xon.length]
var m2 =xon[(yon-2+ xon.length) % xon.length]
var m3 =xon[(yon-1+ xon.length) % xon.length]
var m4= xon[(yon+ xon.length) % xon.length]
var m5 =xon[(yon +1+ xon.length) % xon.length]
var m6 =xon[(yon+2+ xon.length) % xon.length]
var m7= xon[(yon+3+ xon.length) % xon.length]


var b1= banners[(yon-3+ xon.length) % xon.length]
var b2 =banners[(yon-2+ xon.length) % xon.length]
var b3 =banners[(yon-1+ xon.length) % xon.length]
var b4= banners[(yon+ xon.length) % xon.length]
var b5 =banners[(yon +1+ xon.length) % xon.length]
var b6 =banners[(yon+2+ xon.length) % xon.length]
var b7= banners[(yon+3+ xon.length) % xon.length]
}



document.getElementById('image1').setAttribute("src",b1);
document.getElementById('image2').setAttribute("src",b2);
document.getElementById('image3').setAttribute("src",b3);
document.getElementById('image5').setAttribute("src",b5);
document.getElementById('image6').setAttribute("src",b6);
document.getElementById('image7').setAttribute("src",b7);

var testthis=rating[(yon + xon.length) % xon.length];

ratingnow=ratingsys[testthis];


var setcheck = m4.toString();

document.getElementById('changeimage').setAttribute("src", b4);


<xsl:choose>
<xsl:when test="library/category[@current='true' and @name ='Set']">
if (setcheck.substring(0,3) =="Set")
{
document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m4)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
}
else
{
document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m4)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
}
</xsl:when>
<xsl:otherwise>
if (setcheck.substring(0,3) =="Set")
{
	if (flag==0)
		{
		var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")

		document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m4)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",2,"+escape(m4)+".html,"+yon.toString()+","+twoItems[1]+"')");
		

		}

	else

		{
			var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		
			document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m4)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",2,"+escape(m4)+".html,"+yon.toString()+","+genreItems[1]+"')");
		}
}
else
{
if (flag==0)
		{
		var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")

		document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m4)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+twoItems[1]+","+yon.toString()+","+twoItems[1]+"')");
		

		}

	else

		{
			var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		
			document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m4)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+genreItems[1]+","+yon.toString()+","+genreItems[1]+"')");
		}
}
</xsl:otherwise>
</xsl:choose>
clearTimeout(switchTime);

switchTime = setTimeout("changeBG("+yon+")", 1555);
}


function changeBG(y)
{
yon=y;

var mtitle= 0;
var m4= 0;
var mplot=0;

if (searching==0)
{

var fans = findItem( xon, searchlist[(yon + searchlist.length) % searchlist.length])
mtitle= titles[fans];
m4= fanart[fans];
mplot=plots[fans];
}
else
{

m4= fanart[(yon+ xon.length) % xon.length];
mplot=plots[(yon+ xon.length) % xon.length];

<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='TV Shows'">
		mtitle=titles[(yon+xon.length)%xon.length];
	</xsl:when>
	<xsl:otherwise>
		mtitle=titles[(yon+xon.length)%xon.length].split("#")
	</xsl:otherwise>
</xsl:choose>

}
document.getElementById('changeplot').firstChild.nodeValue=mplot;

<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='TV Shows'">
		document.getElementById('changetitle').firstChild.nodeValue=mtitle;
	</xsl:when>
	<xsl:otherwise>
		document.getElementById('changetitle').firstChild.nodeValue=mtitle[0];
		document.getElementById('changeseason').firstChild.nodeValue="Season: "+ mtitle[1];
	</xsl:otherwise>
</xsl:choose>

document.getElementById('changethis').setAttribute('src',m4);
return
}
</script>

<script>
function initpage()
{
if (flag==0)
{

var inittest = findItem( alphaim, <xsl:choose>
		<xsl:when test="//index[@current='true']/@name = '09'">
			"09,Title_09_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'A'">
			"A,Title_A_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'B'">
			"B,Title_B_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'C'">
			"C,Title_C_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'D'">
			"D,Title_D_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'E'">
			"E,Title_E_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'F'">
			"F,Title_F_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'G'">
			"G,Title_G_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'H'">
			"H,Title_H_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'I'">
			"I,Title_I_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'J'">
			"J,Title_J_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'K'">
			"K,Title_K_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'L'">
			"L,Title_L_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'M'">
			"M,Title_M_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'N'">
			"N,Title_N_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'O'">
			"O,Title_O_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'P'">
			"P,Title_P_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Q'">
			"Q,Title_Q_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'R'">
			"R,Title_R_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'S'">
			"S,Title_S_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'T'">
			"T,Title_T_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'U'">
			"U,Title_U_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'V'">
			"V,Title_V_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'W'">
			"W,Title_W_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'X'">
			"X,Title_X_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Y'">
			"Y,Title_Y_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Z'">
			"Z,Title_Z_1.html"
		</xsl:when>
		<xsl:otherwise>"09,Title_09_1.html"</xsl:otherwise></xsl:choose>)

		getParams();
yon=yon
alphaid=inittest
		

		var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")
var m1= xon[(yon-3+ xon.length) % xon.length]
var m2 =xon[(yon-2+ xon.length) % xon.length]
var m3 =xon[(yon-1+ xon.length) % xon.length]
var m4= xon[(yon+ xon.length) % xon.length]
var m5 =xon[(yon+1 + xon.length) % xon.length]
var m6 =xon[(yon+2+ xon.length) % xon.length]
var m7= xon[(yon+3+ xon.length) % xon.length]


	
var b1= banners[(yon-3+ xon.length) % xon.length]
var b2 =banners[(yon-2+ xon.length) % xon.length]
var b3 =banners[(yon-1+ xon.length) % xon.length]
var b4= banners[(yon+ xon.length) % xon.length]
var b5 =banners[(yon +1+ xon.length) % xon.length]
var b6 =banners[(yon+2+ xon.length) % xon.length]
var b7= banners[(yon+3+ xon.length) % xon.length]

document.getElementById('image1').setAttribute("src",b1);
document.getElementById('image2').setAttribute("src",b2);
document.getElementById('image3').setAttribute("src",b3);
document.getElementById('image5').setAttribute("src",b5);
document.getElementById('image6').setAttribute("src",b6);
document.getElementById('image7').setAttribute("src",b7);;

<xsl:choose>
<xsl:when test="//index[@current='true']/@name ='TV Shows'">
var mtitle=titles[(yon+xon.length)%xon.length];
</xsl:when>
<xsl:otherwise>
var mtitle=titles[(yon+xon.length)%xon.length].split("#")
</xsl:otherwise>
</xsl:choose>


document.getElementById('changeplot').firstChild.nodeValue=plots[(yon+ xon.length) % xon.length];

<xsl:choose>
<xsl:when test="//index[@current='true']/@name ='TV Shows'">
document.getElementById('changetitle').firstChild.nodeValue=titles[(yon+xon.length)%xon.length];
</xsl:when>
<xsl:otherwise>
document.getElementById('changetitle').firstChild.nodeValue=mtitle[0];
document.getElementById('changeseason').firstChild.nodeValue="Season: "+ mtitle[1];
</xsl:otherwise>
</xsl:choose>

<xsl:choose>
<xsl:when test="library/category[@current='true' and @name ='Set']">
document.getElementById('backbutton').setAttribute("href","javascript:setParams('"+destset+"?"+yonset+","+genrecnt+","+alphaid+","+flag+",1,"+escape(m4)+".html,"+yon.toString()+","+escape(dest)+"')");

document.getElementById('changeimage').setAttribute("src",b4);
document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m4)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");

</xsl:when>

<xsl:otherwise>

document.getElementById('changeimage').setAttribute("src",b4);
document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m4)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+twoItems[1]+","+yon.toString()+","+twoItems[1]+"')");
				</xsl:otherwise>
</xsl:choose>

				   	
document.getElementById('change').firstChild.nodeValue=twoItems[0];
		document.getElementById('change').setAttribute("href",twoItems[1]);
				   
	  	}

else


	{
		
		var inittest = findItem( genreim, <xsl:choose><xsl:when test="//index[@current='true']/@name = 'All'">
			"All,Other_All_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name ='HD'">
			"HD,Other_HD_1.html"
			</xsl:when>
		<xsl:when test="//index[@current='true']/@name ='TV Shows'">
			"TV Shows,Other_TV Shows_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Movies'">
			"Movies,Other_Movies_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name ='Extras'">
			"Extras,Other_Extras_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'New'">
			"New,Other_New_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Action'">
			"Action,Genres_Action_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Comedy'">
			"Comedy,Genres_Comedy_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Animation'">
			"Animation,Genres_Animation_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Documentary'">
			"Documentary,Genres_Documentary_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Drama'">
			"Drama,Genres_Drama_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Fantasy'">
			"Fantasy,Genres_Fantasy_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Other'">
			"Other,Genres_Other_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Sci-Fi'">
			"Sci-Fi,Genres_Sci-Fi_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Thriller'">
			"Thriller,Genres_Thriller_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Reality-TV'">
			"Reality-TV,Genres_Reality-TV_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Horror'">
			"Horror,Genres_Horror_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Family'">
			"Family,Genres_Family_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Music'">
			"Music,Genres_Music_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Top250'">
			"Top250,Other_Top250_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'HD-720'">
			"HD-720,Other_HD-720_1.html"
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'HD-1080'">
			"HD-1080,Other_HD-1080_1.html"
		</xsl:when>
			<xsl:otherwise>
			"All,Other_All_1.html"</xsl:otherwise></xsl:choose> )

		getParams();
yon=yon
<xsl:choose>
<xsl:when test="library/category[@current='true' and @name ='Set']">genrecnt=genrecnt</xsl:when>
<xsl:otherwise>genrecnt=inittest</xsl:otherwise>
</xsl:choose>


		var genreItems = genreim[(genrecnt+ genreim.length) % genreim.length].split(",")
var m1= xon[(yon-3+ xon.length) % xon.length]
var m2 =xon[(yon-2+ xon.length) % xon.length]
var m3 =xon[(yon-1+ xon.length) % xon.length]
var m4= xon[(yon+ xon.length) % xon.length]
var m5 =xon[(yon+1+ xon.length) % xon.length]
var m6 =xon[(yon+2+ xon.length) % xon.length]
var m7= xon[(yon+3+ xon.length) % xon.length]

	
var b1= banners[(yon-3+ xon.length) % xon.length]
var b2 =banners[(yon-2+ xon.length) % xon.length]
var b3 =banners[(yon-1+ xon.length) % xon.length]
var b4= banners[(yon+ xon.length) % xon.length]
var b5 =banners[(yon +1+ xon.length) % xon.length]
var b6 =banners[(yon+2+ xon.length) % xon.length]
var b7= banners[(yon+3+ xon.length) % xon.length]

document.getElementById('image1').setAttribute("src",b1);
document.getElementById('image2').setAttribute("src",b2);
document.getElementById('image3').setAttribute("src",b3);
document.getElementById('image5').setAttribute("src",b5);
document.getElementById('image6').setAttribute("src",b6);
document.getElementById('image7').setAttribute("src",b7);;

<xsl:choose>
<xsl:when test="//index[@current='true']/@name ='TV Shows'">
var mtitle=titles[(yon+xon.length)%xon.length];
</xsl:when>
<xsl:otherwise>
var mtitle=titles[(yon+xon.length)%xon.length].split("#")
</xsl:otherwise>
</xsl:choose>


document.getElementById('changeplot').firstChild.nodeValue=plots[(yon+ xon.length) % xon.length];

<xsl:choose>
	<xsl:when test="//index[@current='true']/@name ='TV Shows'">
		document.getElementById('changetitle').firstChild.nodeValue=titles[(yon+xon.length)%xon.length];
	</xsl:when>
	<xsl:otherwise>
		document.getElementById('changetitle').firstChild.nodeValue=mtitle[0];
		document.getElementById('changeseason').firstChild.nodeValue="Season: "+ mtitle[1];
	</xsl:otherwise>
</xsl:choose>

<xsl:choose>
	<xsl:when test="library/category[@current='true' and @name ='Set']">
		document.getElementById('backbutton').setAttribute("href","javascript:setParams('"+destset+"?"+yonset+","+genrecnt+","+alphaid+","+flag+",1,"+escape(m4)+".html,"+yon.toString()+","+escape(dest)+"')");
		document.getElementById('changeimage').setAttribute("src",b4);
		document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m4)+".html?0,"+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+escape(dest)+","+yonset.toString()+","+destset+"')");
	</xsl:when>

	<xsl:otherwise>
		document.getElementById('changeimage').setAttribute("src",b4);
		document.getElementById('changemovie').setAttribute("href","javascript:setParams('"+escape(m4)+".html?"+yon.toString()+","+genrecnt.toString()+","+alphaid.toString()+","+flag.toString()+",1,"+genreItems[1]+","+yon.toString()+","+genreItems[1]+"')");
	</xsl:otherwise>
</xsl:choose>

document.getElementById('change').firstChild.nodeValue=genreItems[0];
document.getElementById('change').setAttribute("href",genreItems[1]);


}

	<xsl:if test="$use-menu='true'">menu();</xsl:if>
  	
  }
</script>

<!-- ********************************************************Start of navigation scripts used by all indexes***************************************************-->

<script>

var alphaim=[ 
<xsl:for-each select="library/category[@name='Title']/index">"<xsl:value-of select="@name" />,<xsl:value-of select="."/>.html",
</xsl:for-each>
        ];

 var genreim=[
 <xsl:for-each select="library/category[@name='Other']/index">"<xsl:value-of select="@name" />,<xsl:value-of select="."/>.html",
		 </xsl:for-each>
<xsl:for-each select="library/category[@name='Genres']/index">"<xsl:value-of select="@name" />,<xsl:value-of select="."/>.html",
       </xsl:for-each>
       	    ]


	<xsl:choose>
		<xsl:when test="//index[@current='true']/@name = '09'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'A'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'B'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'C'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'D'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'E'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'F'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'G'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'H'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'I'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'J'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'K'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'L'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'M'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'N'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'O'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'P'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Q'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'R'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'S'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'T'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'U'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'V'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'W'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'X'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Y'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Z'">
			var flag = 0;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'All'">
			var flag = 1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name ='HD'">
			var flag = 1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name ='TV Shows'">
			var flag = 1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Movies'">
			var flag = 1;
		</xsl:when>
		<xsl:when test=" //index[@current='true']/@name ='Extras'">
			var flag = 1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'New'">
			var flag = 1;
		</xsl:when>

		<xsl:when test="//index[@current='true']/@name = 'Action'">
			var flag = 1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Comedy'">
			var flag = 1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Animation'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Documentary'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Drama'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Fantasy'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Other'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Sci-Fi'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Thriller'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Reality-TV'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Horror'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Music'">
			var flag =1;
		</xsl:when>
		<xsl:when test="//index[@current='true']/@name = 'Top250'">
			var flag =1;
		</xsl:when>
		<xsl:otherwise>
			var flag =1;
		</xsl:otherwise>
	</xsl:choose>

function alphaud(x)	//moves the letters left and right 
  	{
	var glen = alphaim.length
	var ending = glen - 1
	var last = ending - 1

  		 if (alphaid+x<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>0)
		 {
		 alphaid=ending
		 }
		 else if (alphaid+x<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>ending)
		 {
		 alphaid=0
		 }
		 else 
		 {
		    alphaid=alphaid+x
			}

		    var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")
		 
					document.getElementById('change').firstChild.nodeValue=twoItems[0];
				   document.getElementById('change').setAttribute("href",twoItems[1]);
  	}

 function genrelist(x)	//moves the genres left and right
  	{
	var glen = genreim.length
	var ending = glen - 1
	var last = ending - 1

  		 if (genrecnt+x<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>0)
		 {
		 genrecnt=ending
		 }
		 else if (genrecnt+x<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>ending)
		 {
		 genrecnt=0
		 }
		 else 
		 {
  		   genrecnt=genrecnt+x;
		 }

		   var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		   
                   document.getElementById('change').firstChild.nodeValue=genreItems[0];
				   document.getElementById('change').setAttribute("href",genreItems[1]);
			
	}

 function loadletter()	//change the list to letters 
  	{
		flag=0
		{
		   alphaid=alphaid
  		   var twoItems = alphaim[(alphaid+ alphaim.length) % alphaim.length].split(",")
		  

                   document.getElementById('change').firstChild.nodeValue=twoItems[0];
				   document.getElementById('change').setAttribute("href",twoItems[1]);

	  	}
return false
  	}

 function loadgenre()	//change the list to genres 
  	{
     flag=1
	 	{
			genrecnt=genrecnt		
  		  var genreItems = genreim[(genrecnt + genreim.length) % genreim.length].split(",")
		   
                   document.getElementById('change').firstChild.nodeValue=genreItems[0];
				   document.getElementById('change').setAttribute("href",genreItems[1]);
	
			 }
		return
  	}
function upDown(x)
{
  if (flag== 0)
    alphaud(x)
  else
    genrelist(x)
  return false
  }

 function changeformat()
 {
 if (flag==0) 
	{
	loadgenre()
	}
 else
	{
	loadletter()
	}
}

function findItem( list, item ) {
	var result = -1;

	for( var i = 0; i != list.length; i++ ) {
	  if( list[i] == item ) {
		return i;
		}
	}
	return result;
}
</script>

<!--****************************************************************END OF NAVIGATION SCRIPTS*******************************************************************-->


<!--****************************************************************MISC SCRIPTS IN THE WORKS*******************************************************************-->
<script>
function initClock() {
        updateClock();
        setInterval('updateClock();', 1000);
    }
    
function updateClock() {

var currentTime = new Date()
  var hours = currentTime.getHours()
  var minutes = currentTime.getMinutes()

  var suffix = "AM";
  if (hours >= 12) {
  suffix = "PM";
  hours = hours - 12;
  }
  if (hours == 0) {
  hours = 12;
  }

  if (minutes <xsl:value-of select="'&lt;'" disable-output-escaping="yes"/> 10)
  minutes = "0" + minutes

  document.getElementById('time').firstChild.nodeValue = hours + ":" + minutes + " " + suffix

  var myDate = new Date();
 document.getElementById('date').firstChild.nodeValue = myDate.toDateString();
        
    }
</script>

<script type="text/javascript">
function togglePopup(x)
{
  var temp = document.styleSheets[1].cssRules[(x)].style
  var tempnew = document.styleSheets[1].cssRules[2].style
  if ( temp.visibility == 'visible' )
   {
	temp.visibility = 'hidden'
	tempnew.visibility = 'hidden'
	document.getElementById('navchange').setAttribute("href","#movies4");
  }
  else
   {
	temp.visibility = 'visible'
	tempnew.visibility = 'visible'
	document.getElementById('navchange').setAttribute("href","#middle");
  }
  return
}
</script>

<xsl:if test="$parental-control-on='true'">
<script type="text/javascript">

function prompter() 
{
<xsl:choose>
<xsl:when test="$number-of-children > 1">

if (ratingnow<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>=<xsl:value-of select="$childs-age-youngest"/>)
{
	if (ratingnow<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>=<xsl:value-of select="$childs-age-oldest"/>)
		{		
			var reply = prompt("Password?", "")

				if (reply=="<xsl:value-of select="$parental-password-master"/>")
					{
						return
					}
				else 
					{
						alert ( "Sorry,You have entered the wrong password")
						return false
					}
		}
	<xsl:if test="$number-of-children=3">
	else if (ratingnow<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>=<xsl:value-of select="$childs-age-middle"/>)
		{		
			var reply = prompt("Password?", "")

				if (reply=="<xsl:value-of select="$parental-password-oldest"/>" || reply=="<xsl:value-of select="$parental-password-master"/>")
					{
						return
					}
				else 
					{
						alert ( "Sorry,You have entered the wrong password")
						return false
					}
		}
	</xsl:if>

	else
		{		
			var reply = prompt("Password?", "")

				if (reply=="<xsl:value-of select="$parental-password-middle"/>" || reply=="<xsl:value-of select="$parental-password-oldest"/>" || reply=="<xsl:value-of select="$parental-password-master"/>")
					{
						return
					}
				else 
					{
						alert ( "Sorry,You have entered the wrong password")
						return false
					}
		}
}
</xsl:when>
<xsl:otherwise>
if (ratingnow<xsl:value-of select="'&gt;'" disable-output-escaping="yes"/>=<xsl:value-of select="$childs-age-youngest"/>)
{
	var reply = prompt("What's the Password?", "")

				if (reply=="<xsl:value-of select="$parental-password-master"/>")
					{
						return
					}
				else 
					{
						alert ( "Sorry,You have entered the wrong password")
						return false
					}
		}
}
</xsl:otherwise>
</xsl:choose>
else
{
return
}


}
</script>
</xsl:if>

<xsl:if test="$use-menu='true'">
<SCRIPT>
	var helpscreen= [
	
	<xsl:for-each select="library/category[@name='Title']/index">
	<xsl:choose>
		<xsl:when test="@name = '09'">
			"09: 1",
		</xsl:when>
		<xsl:when test="@name = 'A'">
			"A: 2",
		</xsl:when>
		<xsl:when test="@name = 'B'">
			"B: 22",
		</xsl:when>
		<xsl:when test="@name = 'C'">
			"C: 222",
		</xsl:when>
		<xsl:when test="@name = 'D'">
			"D: 3",
		</xsl:when>
		<xsl:when test="@name = 'E'">
			"E: 33",
		</xsl:when>
		<xsl:when test="@name = 'F'">
			"F: 333",
		</xsl:when>
		<xsl:when test="@name = 'G'">
			"G: 4",
		</xsl:when>
		<xsl:when test="@name = 'H'">
			"H: 44",
		</xsl:when>
		<xsl:when test="@name = 'I'">
			"I: 444",
		</xsl:when>
		<xsl:when test="@name = 'J'">
			"J: 5",
		</xsl:when>
		<xsl:when test="@name = 'K'">
			"K: 55",
		</xsl:when>
		<xsl:when test="@name = 'L'">
			"L: 555",
		</xsl:when>
		<xsl:when test="@name = 'M'">
			"M: 6",
		</xsl:when>
		<xsl:when test="@name = 'N'">
			"N: 66",
		</xsl:when>
		<xsl:when test="@name = 'O'">
			"O: 666",
		</xsl:when>
		<xsl:when test="@name = 'P'">
			"P: 7",
		</xsl:when>
		<xsl:when test="@name = 'Q'">
			"Q: 77",
		</xsl:when>
		<xsl:when test="@name = 'R'">
			"R: 777",
		</xsl:when>
		<xsl:when test="@name = 'S'">
			"S: 7777",
		</xsl:when>
		<xsl:when test="@name = 'T'">
			"T: 8",
		</xsl:when>
		<xsl:when test="@name = 'U'">
			"U: 88",
		</xsl:when>
		<xsl:when test="@name = 'V'">
			"V: 888",
		</xsl:when>
		<xsl:when test="@name = 'W'">
			"W: 9",
		</xsl:when>
		<xsl:when test="@name = 'X'">
			"X: 99",
		</xsl:when>
		<xsl:when test="@name = 'Y'">
			"Y: 999",
		</xsl:when>
		<xsl:when test="@name = 'Z'">
			"Z: 9999",
		</xsl:when>
		</xsl:choose>
               </xsl:for-each>
<xsl:for-each select="library/category[@name='Other']/index">
	<xsl:choose>
	    <xsl:when test="@name = 'All'">
			"ALL: 255",
		</xsl:when>
		<xsl:when test="@name = 'HD'">
			"HD: 43",
		</xsl:when>
		<xsl:when test="@name = 'TV Shows'">
			"TV SHOWS: 887",
		</xsl:when>
		<xsl:when test="@name = 'Movies'">
			"MOVIES: 668",
		</xsl:when>
		<xsl:when test="@name = 'Extras'">
			"ExtraS: 398",
		</xsl:when>
		<xsl:when test="@name = 'New'">
			"NEW: 639",
		</xsl:when>
		<xsl:when test="@name = 'Top250'">
			"TOP250: 807",
		</xsl:when>
		<xsl:when test="@name = 'HD-720'">
			"HD-720: 437"
		</xsl:when>
		<xsl:when test="@name = 'HD-1080'">
			"HD-1080: 431"
		</xsl:when>
	</xsl:choose>	    
</xsl:for-each>
<xsl:for-each select="library/category[@name='Genres']/index">
	<xsl:choose>
	    <xsl:when test="@name = 'Action'">
			"ACTION: 228",
		</xsl:when>
		<xsl:when test="@name = 'Animation'">
			"ANIMATION: 264",
		</xsl:when>
		<xsl:when test="@name = 'Comedy'">
			"COMEDY: 266",
		</xsl:when>
		<xsl:when test="@name = 'Documentary'">
			"DOCUMENTARY: 362",
		</xsl:when>
		<xsl:when test="@name = 'Drama'">
			"DRAMA: 372",
		</xsl:when>
		<xsl:when test="@name = 'Fantasy'">
			"FANTASY: 326",
		</xsl:when>
		<xsl:when test="@name = 'Other'">
			"OTHER: 684",
		</xsl:when>
		<xsl:when test="@name = 'Sci-Fi'">
			"SCI-FI: 724",
		</xsl:when>
		<xsl:when test="@name = 'Thriller'">
			"THRILLER: 847",
		</xsl:when>
		<xsl:when test="@name = 'Reality'">
			"REALITY: 732",
		</xsl:when>
		<xsl:when test="@name = 'Horror'">
			"HORROR: 467",
		</xsl:when>
		<xsl:when test="@name = 'Family'">
			"FAMILY: 3264",
		</xsl:when>
		<xsl:when test="@name = 'Music'">
			"MUSIC: 687",
		</xsl:when>
		<xsl:otherwise>
		</xsl:otherwise>
	</xsl:choose>	    
</xsl:for-each>
"NAV MENU: INFO",
"+1 MOVIE: RIGHT",
"-1 MOVIE: LEFT",
"+9 MOVIES: DOWN",
"-9 MOVIES: UP",
"+27 MOVIES: PAGEDOWN",
"-27 MOVIES: PAGEUP",
<xsl:if test="$play-index-files='true'">"PLAY MOVIE: PLAY",</xsl:if>
"<xsl:choose><xsl:when test="//index[@current='true']/@name = 'All'">INDEX.HTM: HOME</xsl:when><xsl:otherwise>All INDEX: HOME</xsl:otherwise></xsl:choose>",
];

function menu()
{
var menulength=helpscreen.length
var i=0;

while (i<xsl:value-of select="'&lt;'" disable-output-escaping="yes"/>=menulength-1)
{
var x=i+1
document.getElementById('div'+x).firstChild.nodeValue=helpscreen[i];
i=i+1;
}
}

function menutoggle()
{
  var temp = document.styleSheets[1].cssRules[21].style
  
   if ( temp.visibility == 'visible' )
   {
	temp.visibility = 'hidden'

	document.styleSheets[1].cssRules[22].style.visibility='hidden'
	document.styleSheets[1].cssRules[23].style.visibility='hidden'
	document.styleSheets[1].cssRules[24].style.visibility='hidden'
	document.styleSheets[1].cssRules[25].style.visibility='hidden'
	document.styleSheets[1].cssRules[26].style.visibility='hidden'
	document.styleSheets[1].cssRules[27].style.visibility='hidden'
	document.styleSheets[1].cssRules[28].style.visibility='hidden'
	document.styleSheets[1].cssRules[29].style.visibility='hidden'
	document.styleSheets[1].cssRules[30].style.visibility='hidden'
	document.styleSheets[1].cssRules[31].style.visibility='hidden'
	document.styleSheets[1].cssRules[32].style.visibility='hidden'
	document.styleSheets[1].cssRules[33].style.visibility='hidden'
	document.styleSheets[1].cssRules[34].style.visibility='hidden'
	document.styleSheets[1].cssRules[35].style.visibility='hidden'
	document.styleSheets[1].cssRules[36].style.visibility='hidden'
	document.styleSheets[1].cssRules[37].style.visibility='hidden'
	document.styleSheets[1].cssRules[38].style.visibility='hidden'
	document.styleSheets[1].cssRules[39].style.visibility='hidden'
	document.styleSheets[1].cssRules[40].style.visibility='hidden'
	document.styleSheets[1].cssRules[41].style.visibility='hidden'
	document.styleSheets[1].cssRules[42].style.visibility='hidden'
	document.styleSheets[1].cssRules[43].style.visibility='hidden'
	document.styleSheets[1].cssRules[44].style.visibility='hidden'
	document.styleSheets[1].cssRules[45].style.visibility='hidden'
	document.styleSheets[1].cssRules[46].style.visibility='hidden'
	document.styleSheets[1].cssRules[47].style.visibility='hidden'
	document.styleSheets[1].cssRules[48].style.visibility='hidden'
	document.styleSheets[1].cssRules[49].style.visibility='hidden'
	document.styleSheets[1].cssRules[50].style.visibility='hidden'
	document.styleSheets[1].cssRules[51].style.visibility='hidden'
	document.styleSheets[1].cssRules[52].style.visibility='hidden'
	document.styleSheets[1].cssRules[53].style.visibility='hidden'
	document.styleSheets[1].cssRules[54].style.visibility='hidden'
	document.styleSheets[1].cssRules[55].style.visibility='hidden'
	document.styleSheets[1].cssRules[56].style.visibility='hidden'
	document.styleSheets[1].cssRules[57].style.visibility='hidden'
	document.styleSheets[1].cssRules[58].style.visibility='hidden'
	document.styleSheets[1].cssRules[59].style.visibility='hidden'
	document.styleSheets[1].cssRules[60].style.visibility='hidden'
	document.styleSheets[1].cssRules[61].style.visibility='hidden'
	document.styleSheets[1].cssRules[62].style.visibility='hidden'
	document.styleSheets[1].cssRules[63].style.visibility='hidden'
	document.styleSheets[1].cssRules[64].style.visibility='hidden'
	document.styleSheets[1].cssRules[65].style.visibility='hidden'
	document.styleSheets[1].cssRules[66].style.visibility='hidden'
	document.styleSheets[1].cssRules[67].style.visibility='hidden'
	document.styleSheets[1].cssRules[68].style.visibility='hidden'
	document.styleSheets[1].cssRules[69].style.visibility='hidden'
	document.styleSheets[1].cssRules[70].style.visibility='hidden'
	document.styleSheets[1].cssRules[71].style.visibility='hidden'
	document.styleSheets[1].cssRules[72].style.visibility='hidden'
	document.styleSheets[1].cssRules[73].style.visibility='hidden'
	document.styleSheets[1].cssRules[74].style.visibility='hidden'
	document.styleSheets[1].cssRules[75].style.visibility='hidden'
	document.styleSheets[1].cssRules[76].style.visibility='hidden'
	document.styleSheets[1].cssRules[77].style.visibility='hidden'
	document.styleSheets[1].cssRules[78].style.visibility='hidden'
	document.styleSheets[1].cssRules[79].style.visibility='hidden'
	document.styleSheets[1].cssRules[80].style.visibility='hidden'
	document.styleSheets[1].cssRules[81].style.visibility='hidden'
	document.styleSheets[1].cssRules[82].style.visibility='hidden'
	document.styleSheets[1].cssRules[83].style.visibility='hidden'
	document.styleSheets[1].cssRules[84].style.visibility='hidden'
	document.styleSheets[1].cssRules[85].style.visibility='hidden'

	document.getElementById('changeimage').setAttribute("onfocussrc","pictures/indexmaincoveroverlay.png");

	document.getElementById('changeimage').focus()
	}

	else
	{

	temp.visibility = 'visible'
	document.styleSheets[1].cssRules[22].style.visibility='visible'
	document.styleSheets[1].cssRules[23].style.visibility='visible'
	document.styleSheets[1].cssRules[24].style.visibility='visible'
	document.styleSheets[1].cssRules[25].style.visibility='visible'
	document.styleSheets[1].cssRules[26].style.visibility='visible'
	document.styleSheets[1].cssRules[27].style.visibility='visible'
	document.styleSheets[1].cssRules[28].style.visibility='visible'
	document.styleSheets[1].cssRules[29].style.visibility='visible'
	document.styleSheets[1].cssRules[30].style.visibility='visible'
	document.styleSheets[1].cssRules[31].style.visibility='visible'
	document.styleSheets[1].cssRules[32].style.visibility='visible'
	document.styleSheets[1].cssRules[33].style.visibility='visible'
	document.styleSheets[1].cssRules[34].style.visibility='visible'
	document.styleSheets[1].cssRules[35].style.visibility='visible'
	document.styleSheets[1].cssRules[36].style.visibility='visible'
	document.styleSheets[1].cssRules[37].style.visibility='visible'
	document.styleSheets[1].cssRules[38].style.visibility='visible'
	document.styleSheets[1].cssRules[39].style.visibility='visible'
	document.styleSheets[1].cssRules[40].style.visibility='visible'
	document.styleSheets[1].cssRules[41].style.visibility='visible'
	document.styleSheets[1].cssRules[42].style.visibility='visible'
	document.styleSheets[1].cssRules[43].style.visibility='visible'
	document.styleSheets[1].cssRules[44].style.visibility='visible'
	document.styleSheets[1].cssRules[45].style.visibility='visible'
	document.styleSheets[1].cssRules[46].style.visibility='visible'
	document.styleSheets[1].cssRules[47].style.visibility='visible'
	document.styleSheets[1].cssRules[48].style.visibility='visible'
	document.styleSheets[1].cssRules[49].style.visibility='visible'
	document.styleSheets[1].cssRules[50].style.visibility='visible'
	document.styleSheets[1].cssRules[51].style.visibility='visible'
	document.styleSheets[1].cssRules[52].style.visibility='visible'
	document.styleSheets[1].cssRules[53].style.visibility='visible'
	document.styleSheets[1].cssRules[54].style.visibility='visible'
	document.styleSheets[1].cssRules[55].style.visibility='visible'
	document.styleSheets[1].cssRules[56].style.visibility='visible'
	document.styleSheets[1].cssRules[57].style.visibility='visible'
	document.styleSheets[1].cssRules[58].style.visibility='visible'
	document.styleSheets[1].cssRules[59].style.visibility='visible'
	document.styleSheets[1].cssRules[60].style.visibility='visible'
	document.styleSheets[1].cssRules[61].style.visibility='visible'
	document.styleSheets[1].cssRules[62].style.visibility='visible'
	document.styleSheets[1].cssRules[63].style.visibility='visible'
	document.styleSheets[1].cssRules[64].style.visibility='visible'
	document.styleSheets[1].cssRules[65].style.visibility='visible'
	document.styleSheets[1].cssRules[66].style.visibility='visible'
	document.styleSheets[1].cssRules[67].style.visibility='visible'
	document.styleSheets[1].cssRules[68].style.visibility='visible'
	document.styleSheets[1].cssRules[69].style.visibility='visible'
	document.styleSheets[1].cssRules[70].style.visibility='visible'
	document.styleSheets[1].cssRules[71].style.visibility='visible'
	document.styleSheets[1].cssRules[72].style.visibility='visible'
	document.styleSheets[1].cssRules[73].style.visibility='visible'
	document.styleSheets[1].cssRules[74].style.visibility='visible'
	document.styleSheets[1].cssRules[75].style.visibility='visible'
	document.styleSheets[1].cssRules[76].style.visibility='visible'
	document.styleSheets[1].cssRules[77].style.visibility='visible'
	document.styleSheets[1].cssRules[78].style.visibility='visible'
	document.styleSheets[1].cssRules[79].style.visibility='visible'
	document.styleSheets[1].cssRules[80].style.visibility='visible'
	document.styleSheets[1].cssRules[81].style.visibility='visible'
	document.styleSheets[1].cssRules[82].style.visibility='visible'
	document.styleSheets[1].cssRules[83].style.visibility='visible'
	document.styleSheets[1].cssRules[84].style.visibility='visible'
	document.styleSheets[1].cssRules[85].style.visibility='visible'

	document.getElementById('changeimage').setAttribute("onfocussrc","pictures/indexmaincoveroverlay-blank.png");


	document.getElementById('menutoggle').focus()
   }
   
  return false
}

</SCRIPT>
</xsl:if>

<!--*************************************END of REDEFINED MISC SCRIPTS*********************************************-->



</xsl:template>

<!--*******************************************************END OF STYLE AND JAVASCRIPT****************************************************-->



<!--*******************************************************START OF HTML******************************************************************-->
 
<xsl:template name="tv-index-html">

<xsl:attribute name="background">pictures/tv-index-background.jpg</xsl:attribute>

<xsl:for-each select="library/category[@name='Title']/index">
	<xsl:choose>
		<xsl:when test="@name = '09'">
			<a href="Title_09_1.html" tvid="1"></a>
		</xsl:when>
		<xsl:when test="@name = 'A'">
			<a href="Title_A_1.html" tvid="2"></a>
		</xsl:when>
		<xsl:when test="@name = 'B'">
			<a href="Title_B_1.html" tvid="22"></a>
		</xsl:when>
		<xsl:when test="@name = 'C'">
			<a href="Title_C_1.html" tvid="222"></a>
		</xsl:when>
		<xsl:when test="@name = 'D'">
			<a href="Title_D_1.html" tvid="3"></a>
		</xsl:when>
		<xsl:when test="@name = 'E'">
			<a href="Title_E_1.html" tvid="33"></a>
		</xsl:when>
		<xsl:when test="@name = 'F'">
			<a href="Title_F_1.html" tvid="333"></a>
		</xsl:when>
		<xsl:when test="@name = 'G'">
			<a href="Title_G_1.html" tvid="4"></a>
		</xsl:when>
		<xsl:when test="@name = 'H'">
			<a href="Title_H_1.html" tvid="44"></a>
		</xsl:when>
		<xsl:when test="@name = 'I'">
			<a href="Title_I_1.html" tvid="444"></a>
		</xsl:when>
		<xsl:when test="@name = 'J'">
			<a href="Title_J_1.html" tvid="5"></a>
		</xsl:when>
		<xsl:when test="@name = 'K'">
			<a href="Title_K_1.html" tvid="55"></a>
		</xsl:when>
		<xsl:when test="@name = 'L'">
			<a href="Title_L_1.html" tvid="555"></a>
		</xsl:when>
		<xsl:when test="@name = 'M'">
			<a href="Title_M_1.html" tvid="6"></a>
		</xsl:when>
		<xsl:when test="@name = 'N'">
			<a href="Title_N_1.html" tvid="66"></a>
		</xsl:when>
		<xsl:when test="@name = 'O'">
			<a href="Title_O_1.html" tvid="666"></a>
		</xsl:when>
		<xsl:when test="@name = 'P'">
			<a href="Title_P_1.html" tvid="7"></a>
		</xsl:when>
		<xsl:when test="@name = 'Q'">
			<a href="Title_Q_1.html" tvid="77"></a>
		</xsl:when>
		<xsl:when test="@name = 'R'">
			<a href="Title_R_1.html" tvid="777"></a>
		</xsl:when>
		<xsl:when test="@name = 'S'">
			<a href="Title_S_1.html" tvid="7777"></a>
		</xsl:when>
		<xsl:when test="@name = 'T'">
			<a href="Title_T_1.html" tvid="8"></a>
		</xsl:when>
		<xsl:when test="@name = 'U'">
			<a href="Title_U_1.html" tvid="88"></a>
		</xsl:when>
		<xsl:when test="@name = 'V'">
			<a href="Title_V_1.html" tvid="888"></a>
		</xsl:when>
		<xsl:when test="@name = 'W'">
			<a href="Title_W_1.html" tvid="9"></a>
		</xsl:when>
		<xsl:when test="@name = 'X'">
			<a href="Title_X_1.html" tvid="99"></a>
		</xsl:when>
		<xsl:when test="@name = 'Y'">
			<a href="Title_Y_1.html" tvid="999"></a>
		</xsl:when>
		<xsl:when test="@name = 'Z'">
			<a href="Title_Z_1.html" tvid="9999"></a>
		</xsl:when>

		<xsl:otherwise>
		<a href="blank" tvid="blank"></a>
		</xsl:otherwise>
		</xsl:choose>
               </xsl:for-each>

<xsl:for-each select="library/category[@name='Other']/index">
	<xsl:choose>
	    <xsl:when test="@name = 'All'">
			<a href="Other_All_1.html" tvid="255"/>
		</xsl:when>
		<xsl:when test="@name = 'HD'">
			<a href="Other_HD_1.html" tvid="43"/>
		</xsl:when>
		<xsl:when test="@name = 'TV Shows'">
			<a href="Other_TV Shows_1.html" tvid="887"/>
		</xsl:when>
		<xsl:when test="@name = 'Movies'">
			<a href="Other_Movies_1.html" tvid="668"/>
		</xsl:when>
		<xsl:when test="@name = 'Extras'">
			<a href="Other_Extras_1.html" tvid="398"/>
		</xsl:when>
		<xsl:when test="@name = 'New'">
			<a href="Other_New_1.html" tvid="639"/>
		</xsl:when>
		<xsl:when test="@name = 'Top250'">
			<a href="Other_Top250_1.html" tvid="807"/>
		</xsl:when>
		<xsl:when test="@name = 'HD-720'">
			<a href="Other_HD-720_1.html" tvid="437"/>
		</xsl:when>
		<xsl:when test="@name = 'HD-1080'">
			<a href="Other_HD-1080_1.html" tvid="431"/>
		</xsl:when>
		<xsl:otherwise>
		<a href="blank" tvid="blank"></a>
		</xsl:otherwise>
	</xsl:choose>	    
</xsl:for-each>

<xsl:for-each select="library/category[@name='Genres']/index">
	<xsl:choose>
	    <xsl:when test="@name = 'Action'">
			<a href="Genres_Action_1.html" tvid="228"/>
		</xsl:when>
		<xsl:when test="@name = 'Animation'">
			<a href="Genres_Animation_1.html" tvid="264"/>
		</xsl:when>
		<xsl:when test="@name = 'Comedy'">
			<a href="Genres_Comedy_1.html" tvid="266"/>
		</xsl:when>
		<xsl:when test="@name = 'Documentary'">
			<a href="Genres_Documentary_1.html" tvid="362"/>
		</xsl:when>
		<xsl:when test="@name = 'Drama'">
			<a href="Genres_Drama_1.html" tvid="372"/>
		</xsl:when>
		<xsl:when test="@name = 'Fantasy'">
			<a href="Genres_Fantasy_1.html" tvid="326"/>
		</xsl:when>
		<xsl:when test="@name = 'Other'">
			<a href="Genres_Other_1.html" tvid="684"/>
		</xsl:when>
		<xsl:when test="@name = 'Sci-Fi'">
			<a href="Genres_Sci-Fi_1.html" tvid="724"/>
		</xsl:when>
		<xsl:when test="@name = 'Thriller'">
			<a href="Genres_Thriller_1.html" tvid="847"/>
		</xsl:when>
		<xsl:when test="@name = 'Reality'">
			<a href="Genres_Reality_1.html" tvid="732"/>
		</xsl:when>
		<xsl:when test="@name = 'Horror'">
			<a href="Genres_Horror_1.html" tvid="467"/>
		</xsl:when>
		<xsl:when test="@name = 'Family'">
			<a href="Genres_Family_1.html" tvid="3264"/>
		</xsl:when>
		<xsl:when test="@name = 'Music'">
			<a href="Genres_Music_1.html" tvid="687"/>
		</xsl:when>
		<xsl:otherwise>
		<a href="blank" tvid="blank"></a>
		</xsl:otherwise>
	</xsl:choose>	    
</xsl:for-each>

<a href="#" onclick="return togglePopup(1)" id="navchange" tvid="info" />

<xsl:if test="library/category[@current='true' and @name ='Set']">
<a href="#" id="backbutton" tvid="back"/>
</xsl:if>

<a href="#middle" onclick="testing()" tvid="clear"/>
<a href="#middle" onfocusload="" onfocus="return changeformat()" onclick="return changeformat()" name="leters" class="sorting2" TVID="GREEN"></a>
<a href="#middle" onfocusload="" onfocus="return upDown(-1)" onclick="return upDown(-1)" name="left" onkeyrightset="middle" id="up" TVID="RED"></a>
<a href="#middle" onfocusload="" onfocus="return upDown(1)" onclick="return upDown(1)" name="right" onkeyleftset="middle" id="down" TVID="BLUE"></a>
<a href="#" onclick="searchthis()" id="menutoggle" name="menutoggle"><xsl:attribute name="tvid"><xsl:value-of select="$search-button"/></xsl:attribute></a>



<a href="#movies4" onfocusload="" onfocus="return moviechange(7)" onclick="return moviechange(7)" name="rightn"/>
<a href="#movies4" onfocusload="" onfocus="return moviechange(-7)" onclick="return moviechange(-7)" name="leftn"/>
<a href="#movies4" onfocusload="" onfocus="return moviechange(1)" onclick="return moviechange(1)" name="downn"/>
<a href="#movies4" onfocusload="" onfocus="return moviechange(-1)" onclick="return moviechange(-1)" name="upn"/>


<xsl:if test="$use-parental-ratings-type2='true'">
	<a href="#" id="passwordedmovie">
		<xsl:attribute name="tvid"><xsl:value-of select="$parental-control-type2-password"/></xsl:attribute>
	</a>
</xsl:if>


<table width="1100" height="656" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td width="550">
			<table align="center">
				<tr>
					<td id="one" align="center">
						<img width="400" id="image1">
							<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/bannerFile"/></xsl:attribute>
						</img>
					</td>
				</tr>
				<tr>
					<td id="two" align="center">
						<img width="400" id="image2">
							<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/bannerFile"/></xsl:attribute>
						</img>
					</td>
				</tr>
				<tr>
					<td id="three" align="center">
						<img width="400" id="image3">
							<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/bannerFile"/></xsl:attribute>
						</img>
					</td>
				</tr>
				<tr>
					<td id="four" align="center">
						<a id="changemovie" name="movies4" onkeyupset="upn" onkeydownset="downn" onkeyleftset="leftn" onkeyrightset="rightn">
							<xsl:attribute name="href"><xsl:value-of select="library/movies/movie[position()=1]/baseFilename"/>.html</xsl:attribute>
							<xsl:if test="$parental-control-on='true'">
								<xsl:attribute name="onclick">return prompter()</xsl:attribute>
							</xsl:if>
						<img width="500" id="changeimage" onkeyupset="upn" onkeydownset="downn" onkeyleftset="leftn" onkeyrightset="rightn" onfocussrc="pictures/tran.png">
							<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/bannerFile"/></xsl:attribute>
						</img>
						</a>
					</td>
				</tr>
				<tr>
					<td id="five" align="center">
						<img width="400" id="image5">
							<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=2]/bannerFile"/></xsl:attribute>
						</img>
					</td>
				</tr>
				<tr>
					<td id="six" align="center">
						<img width="400" id="image6">
							<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=3]/bannerFile"/></xsl:attribute>
						</img>
					</td>
				</tr>
				<tr>
					<td id="seven" align="center">
						<img width="400" id="image7">
							<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=4]/bannerFile"/></xsl:attribute>
						</img>
					</td>
				</tr>
			</table>
		</td>
		<td height="656">
			<table>
				<tr>
					<td align="center">
						<img width="450" id="changethis">
							<xsl:attribute name="src"><xsl:value-of select="library/movies/movie[position()=1]/fanartFile"/></xsl:attribute>
						</img>
					</td>
				</tr>
				<tr>
					<td height="325">
						<table background="pictures/tv-plot-background.png" cellpadding="10">
							<tr>
								<xsl:choose>
								<xsl:when test="//index[@current='true']/@name ='TV Shows'">
									<td class="mainsorting" id="changetitle"><xsl:value-of select="library/movies/movie[position()=1]/title"/></td>
								</xsl:when>
								<xsl:otherwise>
									<td class="mainsorting" id="changetitle"><xsl:value-of select="library/movies/movie[position()=1]/title"/></td>
									<td class="mainsorting" id="changeseason">Season: <xsl:value-of select="library/movies/movie[position()=1]/season"/></td>
								</xsl:otherwise>
								</xsl:choose>
							</tr>
							<tr>
								
								<xsl:choose>
								<xsl:when test="//index[@current='true']/@name ='TV Shows'">
									<td class="sorting2" id="changeplot"><xsl:value-of select="library/movies/movie[position()=1]/plot"/></td>
								</xsl:when>
								<xsl:otherwise>
									<td class="sorting2" id="changeplot" colspan="2"><xsl:value-of select="library/movies/movie[position()=1]/plot"/></td>
								</xsl:otherwise>
								</xsl:choose>
							</tr>
						</table>
					</td>
				</tr>				
			</table>
		</td>
	</tr>
</table>
		<img src="pictures/tv-fanart-frame.png" id="tvfanartoverlay"/>
		<div id="navimage">
				<img src="pictures/navbar2.png"/>
		</div>
		<div id="navlinks" align="center" valign="center" height="50">
			<a href="Other_All_1.html" class="mainsorting" name="middle" onkeyupset="leters" onkeydownset="leters" onkeyleftset="left" onkeyrightset="right" id="change">All</a>
		</div>




</xsl:template>


</xsl:stylesheet>